const webpack = require('webpack');
const webpackDevServer = require('webpack-dev-server')
const config = require('./webpack.dev.js');
const compiler = webpack(config);
const options = {
  contentBase: './dist',
  hot: true,
  open: true,
  host: 'localhost',
  // before(app) {
  //   // mock
  // }
}
webpackDevServer.addDevServerEntrypoints(config, options);
const server = new webpackDevServer(compiler, options);

// Serve the files on port 3000.
server.listen(3003, 'localhost', function () {
  console.log('Example app listening on port 3000!\n');
});